
(function(doc, win) {
	var tid
	var docEl = doc.documentElement,
		resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
		recalc = function() {
			var clientWidth = docEl.clientWidth;
			//            alert(clientWidth);
			if(!clientWidth) return;
			docEl.style.fontSize = 100 * (clientWidth / 750) + 'px';
			//          alert(100 * (clientWidth / 640))
			if(clientWidth >= 750) {
				docEl.style.fontSize = '100px';
			}
		};
	if(!doc.addEventListener) return;

	win.addEventListener(resizeEvt, function() {
		clearTimeout(tid);
		//        alert(1);
		tid = setTimeout(recalc, 300);
	}, false);
	win.addEventListener('pageshow', function(e) {
		if(e.persisted) {
			//        alert(2);

			clearTimeout(tid);
			tid = setTimeout(recalc, 300);
		}
	}, false);

	doc.addEventListener('DOMContentLoaded', function() {
		//        alert(3);

		tid = setTimeout(recalc, 0);
	}, false);

	recalc();
	

})(document, window);
//适配rem
